import { Sequelize ,DataTypes } from "sequelize";

const sequelize = new Sequelize({
    dialect:'sqlite',
    storage:'./test.db'
});



export const User = sequelize.define('User',{
    username: DataTypes.STRING,
    birthday: DataTypes.DATE,
});

export const sync = async function () {
    try {
        await sequelize.authenticate();
        console.log('Connection has been established successfully.');
    } catch (error) {
        console.error('Unable to connect to the database:', error);
    }
    await sequelize.sync()
}